package controller;

import java.awt.event.*;
import model.*;
import view.View;

public class Controller {
	private View view;
	private Model model;
	
	public Controller(){
		view = new View();
		model = new Model();
		view.addBtnSolve(new BtnSolveActionListener());
	}
	
	class BtnSolveActionListener implements ActionListener{
		@Override
		public void actionPerformed(ActionEvent e) {
			Input in = view.getInput();
			
			if(in != null){
				model.setInput(in);
				model.solve();
				view.setTblIterationsModel(model.getTableModel());
				view.setCharts(model.getCharts());
				view.setXChart(model.getXChart());
			}
		}
	}
}
